package com.itbaizhan.clouddemoproduct.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName tb_product
 */
@TableName(value ="tb_product")
@Data
public class Product implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 
     */
    @TableField(value = "item_name")
    private String itemName;

    /**
     * 
     */
    @TableField(value = "item_price")
    private Integer itemPrice;

    /**
     * 
     */
    @TableField(value = "item_factory")
    private String itemFactory;

    /**
     * 
     */
    @TableField(value = "item_producing_date")
    private Date itemProducingDate;

    /**
     * 
     */
    @TableField(value = "item_unit")
    private String itemUnit;

    /**
     * 
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Product other = (Product) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getItemName() == null ? other.getItemName() == null : this.getItemName().equals(other.getItemName()))
            && (this.getItemPrice() == null ? other.getItemPrice() == null : this.getItemPrice().equals(other.getItemPrice()))
            && (this.getItemFactory() == null ? other.getItemFactory() == null : this.getItemFactory().equals(other.getItemFactory()))
            && (this.getItemProducingDate() == null ? other.getItemProducingDate() == null : this.getItemProducingDate().equals(other.getItemProducingDate()))
            && (this.getItemUnit() == null ? other.getItemUnit() == null : this.getItemUnit().equals(other.getItemUnit()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getItemName() == null) ? 0 : getItemName().hashCode());
        result = prime * result + ((getItemPrice() == null) ? 0 : getItemPrice().hashCode());
        result = prime * result + ((getItemFactory() == null) ? 0 : getItemFactory().hashCode());
        result = prime * result + ((getItemProducingDate() == null) ? 0 : getItemProducingDate().hashCode());
        result = prime * result + ((getItemUnit() == null) ? 0 : getItemUnit().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", itemName=").append(itemName);
        sb.append(", itemPrice=").append(itemPrice);
        sb.append(", itemFactory=").append(itemFactory);
        sb.append(", itemProducingDate=").append(itemProducingDate);
        sb.append(", itemUnit=").append(itemUnit);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}